package com.company.project.modular.system.warpper;

import com.company.project.core.base.warpper.BaseControllerWarpper;

import java.util.List;
import java.util.Map;

/**
 * 领导审核的包装类
 *
 * @author lsf
 * @date 2018年10月31日 上午10:47:03
 */
public class AuditWarpper extends BaseControllerWarpper {

    public AuditWarpper(List<Map<String, Object>> list) {
        super(list);
    }

    @Override
    public void warpTheMap(Map<String, Object> map) {
        /*走字典,没有实现*/
        //map.put("auditPass", ConstantFactory.me().getAuditPass((Integer) map.get("auditPass")));
        /*不走字典*/
        if(map.get("auditPass")==null) {
            map.put("auditPass", "尚未开始审核");
        }else{
            if ("1".equals(map.get("auditPass").toString())) {
                map.put("auditPass", "审核已通过");
            }else if ("2".equals(map.get("auditPass").toString())) {
                map.put("auditPass", "审核未通过");
            }else if ("3".equals(map.get("auditPass").toString())) {
                map.put("auditPass", "未审核");
            } else{
                map.put("auditPass", "错误的审核");
            }

        }
      /*  switch(map.get("auditPass").toString()) {
            case "1":
                map.put("auditPass", "审核已通过");
                break;
            case "2":
                map.put("auditPass", "审核未通过");
                break;
            case "3":
                map.put("auditPass", "未审核");
                break;
            default:
                map.put("auditPass", "未知审核");
                break;
        }*/

        if(map.get("auditState")==null) {
            map.put("auditState", "无效的申请属性");
        }else{
            if ("1".equals(map.get("auditState").toString())) {
                map.put("auditState", "报买申请");
                }else if ("2".equals(map.get("auditState").toString())) {
                    map.put("auditState", "采购申请");
                    }else if ("3".equals(map.get("auditState").toString())) {
                    map.put("auditState", "兄弟单位申请");
                        } else{
                            map.put("auditState", "错误的数据");
                            }

        }

        if(map.get("purState")==null) {
            map.put("purState", "未回购");
        }else{
            if ("1".equals(map.get("purState").toString())) {
                map.put("purState", "未回购");
            }else if ("2".equals(map.get("purState").toString())) {
                map.put("purState", "正在回购");
            }else if ("3".equals(map.get("purState").toString())) {
                map.put("purState", "已回购");
            } else{
                map.put("purState", "未回购");
            }

        }

    }

}
